<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>
  Module: RecordHistory::Model::InstanceMethods
  
    &mdash; Documentation by YARD 0.7.5
  
</title>

  <link rel="stylesheet" href="../../css/style.css" type="text/css" media="screen" charset="utf-8" />

  <link rel="stylesheet" href="../../css/common.css" type="text/css" media="screen" charset="utf-8" />

<script type="text/javascript" charset="utf-8">
  relpath = '../..';
  if (relpath != '') relpath += '/';
</script>

  <script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>

  <script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>


  </head>
  <body>
    <script type="text/javascript" charset="utf-8">
      if (window.top.frames.main) document.body.className = 'frames';
    </script>
    
    <div id="header">
      <div id="menu">
  
    <a href="../../_index.html">Index (I)</a> &raquo; 
    <span class='title'><span class='object_link'><a href="../../RecordHistory.html" title="RecordHistory (module)">RecordHistory</a></span></span> &raquo; <span class='title'><span class='object_link'><a href="../Model.html" title="RecordHistory::Model (module)">Model</a></span></span>
     &raquo; 
    <span class="title">InstanceMethods</span>
  
  
  <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
</div>

      <div id="search">
  
    <a id="class_list_link" href="#">Class List</a>
  
    <a id="method_list_link" href="#">Method List</a>
  
    <a id="file_list_link" href="#">File List</a>
  
</div>
      <div class="clear"></div>
    </div>
    
    <iframe id="search_frame"></iframe>
    
    <div id="content"><h1>Module: RecordHistory::Model::InstanceMethods
  
  
  
</h1>

<dl class="box">
  
  
    
  
    
  
  
  
    <dt class="r1 last">Defined in:</dt>
    <dd class="r1 last">lib/record_history/has_record_history.rb</dd>
  
</dl>
<div class="clear"></div>








  
    <h2>
      Instance Method Summary
      <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
    </h2>

    <ul class="summary">
      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#build_record_history_obj-instance_method" title="#build_record_history_obj (instance method)">- (Object) <strong>build_record_history_obj</strong> </a>
    

    
  </span>
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'></div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#save_record_history_obj-instance_method" title="#save_record_history_obj (instance method)">- (Object) <strong>save_record_history_obj</strong> </a>
    

    
  </span>
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'></div></span>
  
</li>

      
    </ul>
  



  <div id="instance_method_details" class="method_details_list">
    <h2>Instance Method Details</h2>
    
    
      <div class="method_details first">
  <p class="signature first" id="build_record_history_obj-instance_method">
  
    - (<tt>Object</tt>) <strong>build_record_history_obj</strong> 
  

  
</p><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'lib/record_history/has_record_history.rb', line 40</span>

<span class='kw'>def</span> <span class='id identifier rubyid_build_record_history_obj'>build_record_history_obj</span>
     <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_record_history_obj'>record_history_obj</span> <span class='op'>||=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
	<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='period'>.</span><span class='id identifier rubyid_attributes'>attributes</span><span class='period'>.</span><span class='id identifier rubyid_keys'>keys</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_attr_name'>attr_name</span><span class='op'>|</span>
		<span class='kw'>if</span> <span class='lparen'>(</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_send'>send</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_attr_name'>attr_name</span><span class='rbrace'>}</span><span class='tstring_content'>_changed?</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span><span class='rparen'>)</span>
         <span class='kw'>next</span> <span class='kw'>if</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='period'>.</span><span class='id identifier rubyid_record_history_only'>record_history_only</span> <span class='op'>&amp;&amp;</span> <span class='op'>!</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='period'>.</span><span class='id identifier rubyid_record_history_only'>record_history_only</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span><span class='lparen'>(</span><span class='id identifier rubyid_attr_name'>attr_name</span><span class='rparen'>)</span>
         <span class='kw'>next</span> <span class='kw'>if</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='period'>.</span><span class='id identifier rubyid_record_history_ignore'>record_history_ignore</span> <span class='op'>&amp;&amp;</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_record_history_ignore'>record_history_ignore</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span><span class='lparen'>(</span><span class='id identifier rubyid_attr_name'>attr_name</span><span class='rparen'>)</span>
			<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_record_history_obj'>record_history_obj</span> <span class='op'>&lt;&lt;</span> <span class='const'>RecordHistoryModel</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span>
								<span class='symbol'>:item_type</span> <span class='op'>=&gt;</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='period'>.</span><span class='id identifier rubyid_name'>name</span><span class='comma'>,</span>
                   <span class='symbol'>:item_id</span> <span class='op'>=&gt;</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='comma'>,</span>
                   <span class='symbol'>:attr_name</span> <span class='op'>=&gt;</span> <span class='id identifier rubyid_attr_name'>attr_name</span><span class='comma'>,</span>
                   <span class='symbol'>:old_value</span> <span class='op'>=&gt;</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_send'>send</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_attr_name'>attr_name</span><span class='rbrace'>}</span><span class='tstring_content'>_was</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span><span class='comma'>,</span>
                   <span class='symbol'>:new_value</span> <span class='op'>=&gt;</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_send'>send</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_attr_name'>attr_name</span><span class='rbrace'>}</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span><span class='comma'>,</span>
                   <span class='symbol'>:author</span> <span class='op'>=&gt;</span> <span class='const'>RecordHistory</span><span class='period'>.</span><span class='id identifier rubyid_author'>author</span>
			<span class='rparen'>)</span>
		<span class='kw'>end</span>
	<span class='kw'>end</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="save_record_history_obj-instance_method">
  
    - (<tt>Object</tt>) <strong>save_record_history_obj</strong> 
  

  
</p><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


58
59
60</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'lib/record_history/has_record_history.rb', line 58</span>

<span class='kw'>def</span> <span class='id identifier rubyid_save_record_history_obj'>save_record_history_obj</span>
     <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_record_history_obj'>record_history_obj</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span><span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_item'>item</span><span class='op'>|</span> <span class='id identifier rubyid_item'>item</span><span class='period'>.</span><span class='id identifier rubyid_save'>save</span><span class='rbrace'>}</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
  </div>

</div>
    
    <div id="footer">
  Generated on Fri Feb 24 12:04:59 2012 by 
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
  0.7.5 (ruby-1.9.3).
</div>

  </body>
</html>